---------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\DATA\Dropbox\PoliticalEconomy\analysis.log
  log type:  text
 opened on:   1 Jun 2016, 12:09:41

. 
. use  ita_prov_d.dta

. ren NOME provincia

. replace provincia=lower(provincia)
(103 real changes made)

. sort provincia

. save ita_prov_dtemp, replace
file ita_prov_dtemp.dta saved

. 
. 
. use master, replace

. bysort circ comune year: gen Ncollegi=_N

. gen una_collegio=Ncollegi==1

. gen pochi_elettori=elettori<1200

. 
. 
. *********** SUMMARY STATISTICS
. 
. drop if p_schedebianche==.
(0 observations deleted)

. gen di_turn=turnout*dmdistanza

. gen di_ncand=ncand*dmdistanza

. 
. lab var p_votinonvalidi  "Invalid ballots"

. lab var p_votinonvalidi_p  "Invalid ballots in the proportional race"

. 
. lab var turnout "Turnout"

. lab var turnout_p "Turnout in the proportional race"

. 
. lab var p_schedebianche "Blank ballots" 

. lab var p_schedebianche_p "Blank ballots in the proportional race" 

. 
. lab var lp_votinonvalidi  "log-Invalid ballots"

. lab var lp_votinonvalidi_p  "log-Invalid ballots in the proportional race"

. 
. lab var lturnout "log-Turnout"

. lab var lturnout_p "log-Turnout in the proportional race"

. 
. lab var lp_schedebianche "log-Blank ballots" 

. lab var lp_schedebianche_p "log-Blank ballots in the proportional race" 

. 
. lab var destra1 "Right coalition leads"

. lab var sinistra1 "Left coalition leads"

. lab var wincumb "Incumbent party leads"

. lab var incumbent_present "Incumbent participates"

. lab var incumbent_won "Incumbent leads"

. 
. lab var distanza "Leading margin at electoral unit level" 

. lab var c_distanza "Leading margin at district level" 

. 
. lab var ldistanza "log-Leading margin" 

. lab var N_coll "N. of individual obs."

. lab var ncandidati "Number of candidates"

. lab var lncand "Log-N. of candidates"

. lab var D1996 "Year 1996"

. lab var D2001 "Year 2001"

. replace unemp=unemp/100
(22,979 real changes made)

. lab var unemp_rate "Unemployment rate"

. replace refturnout=refturnout/100
(22,979 real changes made)

. lab var refturnout "Turnout at national referenda"

. 
. replace act_rate=act_rate/100
(22,979 real changes made)

. lab var act_rate "Labor activity rate"

. replace ass_mafiosa=ass_mafiosa>0
(8,752 real changes made)

. lab var ass_mafio "Provinces with mafia-related crimes"

. lab var laurea_rate "Fraction of pop. with university degree"

. lab var diploma_rate "Fraction of pop. with high school degree"

. replace realgdp=real/10000
(22,979 real changes made)

. lab var real "GDP per capita (in \euro 10,000)"

. replace urb_rate=urb/100
(22,979 real changes made)

. lab var urb "Rate of urbanization"

. 
. gen dmafia=NUM_SCIO>0 & NUM_SCI<.

. lab var dmafia "Dissolution of a city council between 1999-2009"

. 
. foreach y of var delitti* mafia{
  2. replace `y'=`y'/pop2001*100
  3. }
(22,884 real changes made)
(2,169 real changes made)
(12,201 real changes made)

. lab var delitti_pa "Corruption Crime Rate (per 100 inh.)"

. lab var mafia "Organized Crime Rate (per 100 inh.)"

. lab var delitti "Total Crime Rate (per 100 inh.)"

. 
. sutex p_votinonvalidi p_schedebianche turnout distanza c_distanza destra1 sinis
> tra1 wincumb /*
> */ incumbent_won ncand delitti_pa mafia dmafia delitti laurea_rate diploma_rate
>  refturnout act_rate /*
> */ unemp_rate realgdp urb_rate , labels min
%------- Begin LaTeX code -------%

\begin{table}[htbp]\centering \caption{Summary statistics \label{sumstat}}
\begin{tabular}{l c c c c c}\hline\hline
\multicolumn{1}{c}{\textbf{Variable}} & \textbf{Mean}
 & \textbf{Std. Dev.}& \textbf{Min.} &  \textbf{Max.} & \textbf{N}\\ \hline
Invalid ballots & 0.039 & 0.022 & 0 & 0.573 & 23019\\
Blank ballots & 0.046 & 0.022 & 0 & 0.245 & 23019\\
Turnout & 0.820 & 0.108 & 0.049 & 1 & 23019\\
Leading margin at electoral unit level & 0.184 & 0.148 & 0 & 0.961 & 23019\\
Leading margin at district level & 0.139 & 0.124 & 0 & 0.756 & 23019\\
Right coalition leads & 0.38 & 0.485 & 0 & 1 & 23019\\
Left coalition leads & 0.362 & 0.481 & 0 & 1 & 23019\\
Incumbent party leads & 0.945 & 0.229 & 0 & 1 & 14965\\
Incumbent leads & 0.264 & 0.441 & 0 & 1 & 14965\\
Number of candidates & 4.136 & 1.005 & 2 & 9 & 23019\\
Corruption Crime Rate (per 100 inh.) & 0.001 & 0.007 & 0 & 0.239 & 23019\\
Organized Crime Rate (per 100 inh.) & 0.007 & 0.012 & 0 & 0.21 & 23019\\
Dissolution of a city council between 1999-2009 & 0.017 & 0.13 & 0 & 1 & 23019\\
Total Crime Rate (per 100 inh.) & 2.926 & 2.161 & 0 & 105.107 & 23019\\
Fraction of pop. with university degree & 0.067 & 0.009 & 0.044 & 0.094 & 22979\\
Fraction of pop. with high school degree & 0.3 & 0.027 & 0.257 & 0.392 & 22979\\
Turnout at national referenda & 0.684 & 0.086 & 0.48 & 0.811 & 22979\\
Labor activity rate & 0.487 & 0.04 & 0.355 & 0.581 & 22979\\
Unemployment rate & 0.093 & 0.077 & 0.017 & 0.305 & 22979\\
GDP per capita (in $\backslash$ euro 10,000) & 1.897 & 0.464 & 1.028 & 3.028 & 22
> 979\\
Rate of urbanization & 0.235 & 0.125 & 0.088 & 0.872 & 22979\\
\hline
\end{tabular}
\end{table}
%------- End LaTeX code -------%

. 
. bysort circ coll comune: egen x=mean(p_votinonvalidi)

. bysort circ coll comune: replace x=100*abs(p_votinonvalidi-x)
(23,016 real changes made)

. bysort circ coll comune: egen adev_invalid=mean(x)

. bysort circ coll comune: egen sd_invalid=sd(p_votinonvalidi)
(120 missing values generated)

. drop x

. bysort circ coll comune: egen x=mean(p_schedebianche)

. bysort circ coll comune: replace x=100*abs(p_schedebianche-x)
(23,019 real changes made)

. bysort circ coll comune: egen adev_blank=mean(x)

. bysort circ coll comune: egen sd_blank=sd(p_schedebianche)
(120 missing values generated)

. bysort circ coll year: egen ysd_invalid=sd(p_votinonvalidi)
(256 missing values generated)

. drop x

. 
. 
. 
. ****** Pivotal
. 
. gen larger=p_votinonvalidi>distanza & p_votinonvalidi<.

. gen larger2=1/2*p_votinonvalidi>distanza & p_votinonvalidi<.

. *table region year , c(mean distanza mean p_votinonvalidi mean larger  mean lar
> ger2)
. 
. 
. 
. preserve

. collapse adev_invalid sd_inv p_votinonvalidi p_schedebianche dmafia (sum) pop20
> 01 mafia delitti* , by(provincia)

. replace provincia="massa carrara" if provincia=="massa-carrara"
(1 real change made)

. replace provincia="pesaro e urbino" if provincia=="pesaro-urbino"
(1 real change made)

. replace provincia="verb-cus-ossola" if provincia=="verbano-cusio-ossola"
(1 real change made)

. replace provincia="pesaro e urbino" if provincia=="pesaro-urbino"
(0 real changes made)

. replace provincia="forli'-cesena" if provincia=="forli-cesena"
(1 real change made)

. replace provincia="forli'-cesena" if provincia=="forli-cesena"
(0 real changes made)

. replace provincia="aosta" if provincia=="valle d'aosta/valle d'aoste"
(1 real change made)

. sort provincia

. merge provincia using ita_prov_dtemp.dta
(note: you are using old merge syntax; see [D] merge for new syntax)

. tab  provincia _m

                      |   _merge
            PROVINCIA |         3 |     Total
----------------------+-----------+----------
            agrigento |         1 |         1 
          alessandria |         1 |         1 
               ancona |         1 |         1 
                aosta |         1 |         1 
               arezzo |         1 |         1 
        ascoli piceno |         1 |         1 
                 asti |         1 |         1 
             avellino |         1 |         1 
                 bari |         1 |         1 
              belluno |         1 |         1 
            benevento |         1 |         1 
              bergamo |         1 |         1 
               biella |         1 |         1 
              bologna |         1 |         1 
              bolzano |         1 |         1 
              brescia |         1 |         1 
             brindisi |         1 |         1 
             cagliari |         1 |         1 
        caltanissetta |         1 |         1 
           campobasso |         1 |         1 
              caserta |         1 |         1 
              catania |         1 |         1 
            catanzaro |         1 |         1 
               chieti |         1 |         1 
                 como |         1 |         1 
              cosenza |         1 |         1 
              cremona |         1 |         1 
              crotone |         1 |         1 
                cuneo |         1 |         1 
                 enna |         1 |         1 
              ferrara |         1 |         1 
              firenze |         1 |         1 
               foggia |         1 |         1 
        forli'-cesena |         1 |         1 
            frosinone |         1 |         1 
               genova |         1 |         1 
              gorizia |         1 |         1 
             grosseto |         1 |         1 
              imperia |         1 |         1 
              isernia |         1 |         1 
             l'aquila |         1 |         1 
            la spezia |         1 |         1 
               latina |         1 |         1 
                lecce |         1 |         1 
                lecco |         1 |         1 
              livorno |         1 |         1 
                 lodi |         1 |         1 
                lucca |         1 |         1 
             macerata |         1 |         1 
              mantova |         1 |         1 
        massa carrara |         1 |         1 
               matera |         1 |         1 
              messina |         1 |         1 
               milano |         1 |         1 
               modena |         1 |         1 
               napoli |         1 |         1 
               novara |         1 |         1 
                nuoro |         1 |         1 
             oristano |         1 |         1 
               padova |         1 |         1 
              palermo |         1 |         1 
                parma |         1 |         1 
                pavia |         1 |         1 
              perugia |         1 |         1 
      pesaro e urbino |         1 |         1 
              pescara |         1 |         1 
             piacenza |         1 |         1 
                 pisa |         1 |         1 
              pistoia |         1 |         1 
            pordenone |         1 |         1 
              potenza |         1 |         1 
                prato |         1 |         1 
               ragusa |         1 |         1 
              ravenna |         1 |         1 
      reggio calabria |         1 |         1 
        reggio emilia |         1 |         1 
                rieti |         1 |         1 
               rimini |         1 |         1 
                 roma |         1 |         1 
               rovigo |         1 |         1 
              salerno |         1 |         1 
              sassari |         1 |         1 
               savona |         1 |         1 
                siena |         1 |         1 
             siracusa |         1 |         1 
              sondrio |         1 |         1 
              taranto |         1 |         1 
               teramo |         1 |         1 
                terni |         1 |         1 
               torino |         1 |         1 
              trapani |         1 |         1 
               trento |         1 |         1 
              treviso |         1 |         1 
              trieste |         1 |         1 
                udine |         1 |         1 
               varese |         1 |         1 
              venezia |         1 |         1 
      verb-cus-ossola |         1 |         1 
             vercelli |         1 |         1 
               verona |         1 |         1 
        vibo valentia |         1 |         1 
              vicenza |         1 |         1 
              viterbo |         1 |         1 
----------------------+-----------+----------
                Total |       103 |       103 


. drop _m

. 
. foreach y of var delitti* mafia{
  2. replace `y'=`y'/pop2001*100000
  3. }
(104 real changes made)
(103 real changes made)
(104 real changes made)

. 
. 
. spmap delitti using ita_prov_c.dta, id(id)  clnumber(9) clmethod(quantile)  nds
> ize(thick) ti("Total Crime Rate")

. graph export figures/delitti_prov.pdf, replace
(file figures/delitti_prov.pdf written in PDF format)

. 
. spmap delitti_pa using ita_prov_c.dta, id(id)  clnumber(9) clmethod(quantile)  
> ndsize(thick) ti("Corruption Crime Rate")

. graph export figures/pa_prov.pdf, replace
(file figures/pa_prov.pdf written in PDF format)

. 
. spmap dmafia using ita_prov_c.dta, id(id)  clnumber(9) clmethod(custom) clbreak
> s(0 0.00001 0.01 0.015 0.02 .1 .2 .25 .3) ndsize(thick) ti("Fraction of Dissolv
> ed City Councils")

. graph export figures/dismantelled_prov.pdf, replace
(file figures/dismantelled_prov.pdf written in PDF format)

. 
. spmap mafia using ita_prov_c.dta, id(id)  clnumber(9) clmethod(quantile)  ndsiz
> e(thick) ti("Organized Crime Rate")

. graph export figures/mafia_prov.pdf, replace
(file figures/mafia_prov.pdf written in PDF format)

. 
. 
. /* This is Figure 3 in the paper*/
. spmap p_voti using ita_prov_c.dta, id(id)  clnumber(9) clmethod(quantile)  ndsi
> ze(thick) 

. graph export figures/pvoti_prov.pdf, replace
(file figures/pvoti_prov.pdf written in PDF format)

. 
. spmap p_schede using ita_prov_c.dta, id(id)  clnumber(9) clmethod(quantile)  nd
> size(thick) 

. graph export figures/pschede_prov.pdf, replace
(file figures/pschede_prov.pdf written in PDF format)

. 
. 
. spmap adev using ita_prov_c.dta, id(id)  clnumber(9) clmethod(quantile)  ndsize
> (thick) 

. graph export figures/adev_prov.pdf, replace
(file figures/adev_prov.pdf written in PDF format)

. restore

. 
. *********/
. 
. 
. **********skip graphs ***********************
. 
. preserve // Simple correlation between voting and margin of victory

. sort distanza

. keep if distanza!=. & p_votinonvalidi!=.
(0 observations deleted)

. gen  pct_dist = int(100*(_n-1)/_N)

. sort pct_dis distanza

. by pct_dis: gen cent_dis=distanza[1]

. by pct_dis: egen minv=mean(p_votinonvalidi)

. by pct_dis: gen n=_n

. by pct_dis: egen mblank=mean(p_schedebianche)

. lab var mblank "Fraction of blank ballots"

. 
. lab var minv "Fraction of invalid ballots"

. lab var cent_dis "Leading margin of the 1st candidate over the 2nd"

. 
. scatter minv cent_dis if n==1, ti("Invalid ballots (full sample)")

. graph export figures/pct.pdf, replace
(file figures/pct.pdf written in PDF format)

. scatter mblank cent_dis if n==1, ti("Blank ballots, margin between 1st and 2nd 
> candidate")

. graph export figures/pblank.pdf, replace
(file figures/pblank.pdf written in PDF format)

. restore

. 
. 
. preserve // Simple correlation between voting and margin of victory

. sort distanza

. keep if distanza!=. & p_votinonvalidi!=.&north==1
(9,758 observations deleted)

. gen  pct_dist = int(100*(_n-1)/_N)

. sort pct_dis distanza

. by pct_dis: gen cent_dis=distanza[1]

. by pct_dis: egen minv=mean(p_votinonvalidi)

. by pct_dis: gen n=_n

. by pct_dis: egen mblank=mean(p_schedebianche)

. lab var mblank "Fraction of blank ballots"

. 
. lab var minv "Fraction of invalid ballots"

. lab var cent_dis "Leading margin of the 1st candidate over the 2nd"

. 
. scatter minv cent_dis if n==1, ti("Invalid ballots, margin between 1st and 2nd 
> candidate")

. graph export figures/pct_north.pdf, replace
(file figures/pct_north.pdf written in PDF format)

. scatter mblank cent_dis if n==1, ti("Blank ballots, margin between 1st and 2nd 
> candidate")

. graph export figures/pblank_north.pdf, replace
(file figures/pblank_north.pdf written in PDF format)

. restore

. 
. preserve //Same thing for municipalities with less than 1200 voters

. sort distanza

. keep if distanza!=. & p_votinonvalidi!=.&elettori<=1200
(15,744 observations deleted)

. gen  pct_dist = int(100*(_n-1)/_N)

. sort pct_dis distanza

. by pct_dis: gen cent_dis=distanza[1]

. by pct_dis: egen minv=mean(p_votinonvalidi)

. by pct_dis: gen n=_n

. by pct_dis: egen mblank=mean(p_schedebianche)

. lab var mblank "Fraction of blank ballots"

. lab var minv "Fraction of invalid ballots"

. lab var cent_dis "Leading margin of the 1st candidate over the 2nd"

. 
. scatter minv cent_dis if n==1&elettori<1200, ti("Invalid ballots (<1200 eligibl
> e voters)")

. graph export figures/pct1200.pdf, replace
(file figures/pct1200.pdf written in PDF format)

. scatter mblank cent_dis if n==1&elettori<1200, ti("Blank ballots, margin betwee
> n 1st and 2nd candidate")

. graph export figures/pblank1200.pdf, replace
(file figures/pblank1200.pdf written in PDF format)

. restore

. 
. 
. 
. preserve // Same thing at the collegio elettorale level

. sort c_distanza

. gen  pct_dist = int(100*(_n-1)/_N)

. sort pct_dis c_distanza

. by pct_dis: gen cent_dis=c_distanza[1]

. by pct_dis: egen minv=mean(p_votinonvalidi)

. by pct_dis: gen n=_n

. by pct_dis: egen mblank=mean(p_schedebianche)

. lab var mblank "Fraction of blank ballots"

. 
. lab var minv "Fraction of invalid ballots"

. lab var cent_dis "Leading margin of the 1st candidate over the 2nd"

. 
. scatter minv cent_dis if n==1&cent_dis<=1, ti("Italy")

. graph export figures/c_pct.pdf, replace
(file figures/c_pct.pdf written in PDF format)

. scatter mblank cent_dis if n==1&cent_dis<=1, ti("Italy")

. graph export figures/c_pblank.pdf, replace
(file figures/c_pblank.pdf written in PDF format)

. restore

. 
. preserve // Do it by level of electoral competition

. qui su c_distanza, de

. gen bmedian=c_distanza<r(p50)

. sort distanza

. gen  pct_dist = int(100*(_n-1)/_N)

. sort bmedian pct_dis distanza

. by bmedian pct_dis: gen cent_dis=distanza[1]

. by bmedian pct_dis: egen minv=mean(p_votinonvalidi)

. by bmedian pct_dis: gen n=_n

. by bmedian pct_dis: egen mblank=mean(p_schedebianche)

. lab var mblank "Fraction of blank ballots"

. 
. lab var minv "Fraction of invalid ballots"

. lab var cent_dis "Leading margin of the 1st candidate over the 2nd"

. 
. 
. twoway(scatter minv cent_dis if n==1&bmedian==0, msy(o) ti("Invalid ballots, ma
> rgin between 1st and 2nd candidate"))/*
> */      (scatter minv cent_dis if n==1&bmedian==1,  msy(d))/*
> */      (lfit minv cent_dis if n==1&bmedian==0)(lfit minv cent_dis if n==1&bmed
> ian==1), legend(label(1 "Non-competitive district") label(2 "Competitive distri
> ct") label(3 "linear fit") label(4 "linear fit"))

. graph export figures/pct_competition.pdf, replace
(file figures/pct_competition.pdf written in PDF format)

. restore

. 
. 
. preserve // Do it by level of electoral competition for municipalities with les
> s than 1200 voters

. keep if elettori<=1200
(15,744 observations deleted)

. qui su c_distanza, de

. gen bmedian=c_distanza<r(p50)

. sort distanza

. gen  pct_dist = int(100*(_n-1)/_N)

. sort bmedian pct_dis distanza

. by bmedian pct_dis: gen cent_dis=distanza[1]

. by bmedian pct_dis: egen minv=mean(p_votinonvalidi)

. by bmedian pct_dis: gen n=_n

. by bmedian pct_dis: egen mblank=mean(p_schedebianche)

. lab var mblank "Fraction of blank ballots"

. 
. lab var minv "Fraction of invalid ballots"

. lab var cent_dis "Leading margin of the 1st candidate over the 2nd"

. 
. twoway(scatter minv cent_dis if n==1&bmedian==0&elettori<1200, msy(o) ti("Inval
> id ballots, margin between 1st and 2nd candidate"))/*
> */      (scatter minv cent_dis if n==1&bmedian==1&elettori<1200,  msy(d))/*
> */      (lfit minv cent_dis if n==1&bmedian==0&elettori<1200)(lfit minv cent_di
> s if n==1&bmedian==1&elettori<1200), legend(label(1 "Non-competitive district")
>  label(2 "Competitive district") label(3 "linear fit") label(4 "linear fit"))

. graph export figures/pct_competition1200.pdf, replace
(file figures/pct_competition1200.pdf written in PDF format)

. restore

. 
. *foreach y of varlist estorsioni ass_mafiosa total_crime{
. foreach y of varlist delitti_pa mafia dmafia{
  2. preserve
  3. replace `y'=`y'/pop2001*100000
  4. qui su `y', de
  5. gen bmedian=`y'<=r(p50)
  6. sort distanza
  7. gen pct_`y' = int(100*(_n-1)/_N)
  8. sort bmedian pct_`y' distanza
  9. by bmedian pct_`y': gen cent_dis=distanza[1]
 10. by bmedian pct_`y': egen minv=mean(p_votinonvalidi)
 11. by bmedian pct_`y': gen n=_n
 12. by bmedian pct_`y': egen mblank=mean(p_schedebianche)
 13. lab var minv "Fraction of invalid ballots"
 14. lab var cent_dis "Leading margin of the 1st candidate over the 2nd"
 15. if "`y'"=="delitti_pa" {
 16. local ti "Invalid ballots and leading margin (Crime: corruption)"
 17. }
 18. if "`y'"=="mafia" {
 19. local ti "Invalid ballots and leading margin (Crime : mafia) "
 20. }
 21. if "`y'"=="dmafia" {
 22. local ti "Invalid ballots and leading margin (Dismissed council)"
 23. }
 24. twoway(scatter minv cent_dis if n==1&bmedian==0, msy(o)  ti("`ti'"))/*
> */      (scatter minv cent_dis if n==1&bmedian==1,  msy(d))/*
> */      (lfit minv cent_dis if n==1&bmedian==0)(lfit minv cent_dis if n==1&bmed
> ian==1), legend(label(1 "Above median") label(2 "Below median") label(3 "linear
>  fit") label(4 "linear fit"))
 25. graph export figures/pct_`y'.pdf, replace
 26. restore
 27. }
(2,169 real changes made)
(file figures/pct_delitti_pa.pdf written in PDF format)
(12,201 real changes made)
(file figures/pct_mafia.pdf written in PDF format)
(397 real changes made)
(file figures/pct_dmafia.pdf written in PDF format)

. 
. 
. ************skip graphs*********/
. 
. *********** REGRESSIONS OLS
. local opt "bdec(4) excel lab nocons"

. 
. 
. local otherX "delitti_pa mafia delitti laurea_rate diploma_rate refturnout act_
> rate unemp_rate realgdp urb_rate"

. 
. * FIRST TABLE
. 
. reg p_votinonvalidi distanza, cluster(id_coll)

Linear regression                               Number of obs     =     23,019
                                                F(1, 474)         =     133.44
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0277
                                                Root MSE          =     .02123

                              (Std. Err. adjusted for 475 clusters in id_coll)
------------------------------------------------------------------------------
             |               Robust
p_votinonv~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    distanza |  -.0241699   .0020923   -11.55   0.000    -.0282813   -.0200585
       _cons |   .0430683   .0008797    48.96   0.000     .0413397    .0447969
------------------------------------------------------------------------------

. outreg2 using tables/lreg1, replace `opt'  
tables/lreg1.xml
dir : seeout

. 
. reg p_votinonvalidi distanza turnout p_schedebianche ncandidati, cluster(id_col
> l)

Linear regression                               Number of obs     =     23,019
                                                F(4, 474)         =      70.12
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1582
                                                Root MSE          =     .01975

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0181394   .0019385    -9.36   0.000    -.0219484   -.0143303
       turnout |  -.0473684   .0061648    -7.68   0.000    -.0594821   -.0352547
p_schedebian~e |      .2085   .0201307    10.36   0.000     .1689436    .2480564
    ncandidati |  -.0006453   .0003993    -1.62   0.107      -.00143    .0001394
         _cons |   .0738426    .005683    12.99   0.000     .0626755    .0850096
--------------------------------------------------------------------------------

. outreg2 using tables/lreg1, `opt'
tables/lreg1.xml
dir : seeout

. 
. reg p_votinonvalidi distanza turnout p_schedebianche ncandidati delitti_pa mafi
> a delitti laurea_rate diploma_rate refturnout act_rate unemp_rate realgdp urb_r
> ate, cluster(id_coll)

Linear regression                               Number of obs     =     22,979
                                                F(14, 472)        =      36.33
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2633
                                                Root MSE          =     .01849

                                (Std. Err. adjusted for 473 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0125268   .0016649    -7.52   0.000    -.0157983   -.0092553
       turnout |  -.0042128   .0075756    -0.56   0.578    -.0190989    .0106732
p_schedebian~e |   .1456954   .0186084     7.83   0.000     .1091298     .182261
    ncandidati |  -.0022379   .0004005    -5.59   0.000    -.0030248   -.0014509
    delitti_pa |    .016582   .0204202     0.81   0.417    -.0235438    .0567078
         mafia |   -.025093    .020404    -1.23   0.219    -.0651868    .0150009
       delitti |  -.0004376   .0001491    -2.94   0.003    -.0007306   -.0001447
   laurea_rate |  -.0390394   .1750752    -0.22   0.824    -.3830627    .3049839
  diploma_rate |  -.1025294     .05202    -1.97   0.049    -.2047489   -.0003099
    refturnout |  -.0357557   .0155905    -2.29   0.022     -.066391   -.0051204
      act_rate |  -.0499703   .0268353    -1.86   0.063    -.1027017    .0027611
    unemp_rate |   .0607231   .0164784     3.69   0.000      .028343    .0931032
       realgdp |   .0007271    .002243     0.32   0.746    -.0036804    .0051345
      urb_rate |   .0119226   .0047042     2.53   0.012     .0026788    .0211665
         _cons |   .1206264   .0190503     6.33   0.000     .0831925    .1580602
--------------------------------------------------------------------------------

. outreg2 using tables/lreg1, `opt'
tables/lreg1.xml
dir : seeout

. 
. areg p_votinonvalidi distanza turnout p_schedebianche ncandidati D*, cluster(id
> _coll) absorb(id)

Linear regression, absorbing indicators         Number of obs     =     23,019
                                                F(   6,    474)   =      37.92
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7023
                                                Adj R-squared     =     0.5386
                                                Root MSE          =     0.0146

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0136521   .0018981    -7.19   0.000    -.0173818   -.0099223
       turnout |    .016448   .0908583     0.18   0.856    -.1620868    .1949828
p_schedebian~e |   .1347091   .0462696     2.91   0.004     .0437901     .225628
    ncandidati |  -.0005346   .0005479    -0.98   0.330    -.0016112    .0005419
         D1996 |   .0039261   .0031874     1.23   0.219     -.002337    .0101892
         D2001 |  -.0002488   .0049471    -0.05   0.960    -.0099697    .0094721
         _cons |   .0225062   .0761074     0.30   0.768    -.1270434    .1720558
---------------+----------------------------------------------------------------
            id |   absorbed                                    (8161 categories)

. outreg2 using tables/lreg1, `opt'
tables/lreg1.xml
dir : seeout

. 
. reg p_votinonvalidi distanza if elettori<=1200, cluster(id_coll)

Linear regression                               Number of obs     =      7,275
                                                F(1, 224)         =      32.62
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0170
                                                Root MSE          =     .02144

                              (Std. Err. adjusted for 225 clusters in id_coll)
------------------------------------------------------------------------------
             |               Robust
p_votinonv~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    distanza |  -.0176887   .0030971    -5.71   0.000    -.0237919   -.0115855
       _cons |   .0420466   .0011681    35.99   0.000     .0397446    .0443485
------------------------------------------------------------------------------

. outreg2 using tables/lreg1b, replace `opt'  
tables/lreg1b.xml
dir : seeout

. 
. reg p_votinonvalidi distanza turnout p_schedebianche ncandidati  if elettori<=1
> 200, cluster(id_coll)

Linear regression                               Number of obs     =      7,275
                                                F(4, 224)         =      29.04
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0853
                                                Root MSE          =     .02069

                                (Std. Err. adjusted for 225 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0138416   .0027932    -4.96   0.000    -.0193459   -.0083373
       turnout |  -.0312219    .007054    -4.43   0.000    -.0451226   -.0173211
p_schedebian~e |   .1652983   .0221304     7.47   0.000     .1216879    .2089086
    ncandidati |  -.0006347   .0006174    -1.03   0.305    -.0018514    .0005821
         _cons |    .060738   .0065416     9.28   0.000     .0478471     .073629
--------------------------------------------------------------------------------

. outreg2 using tables/lreg1b, `opt'
tables/lreg1b.xml
dir : seeout

. 
. reg p_votinonvalidi distanza turnout p_schedebianche ncandidati delitti_pa mafi
> a delitti  laurea_rate diploma_rate refturnout act_rate unemp_rate realgdp urb_
> rate  if elettori<=1200, cluster(id_coll)

Linear regression                               Number of obs     =      7,272
                                                F(14, 224)        =      16.26
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1469
                                                Root MSE          =        .02

                                (Std. Err. adjusted for 225 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0121896   .0029122    -4.19   0.000    -.0179284   -.0064508
       turnout |  -.0074285   .0067701    -1.10   0.274    -.0207696    .0059127
p_schedebian~e |   .1453162   .0187008     7.77   0.000     .1084642    .1821682
    ncandidati |  -.0020368   .0006378    -3.19   0.002    -.0032936     -.00078
    delitti_pa |  -.0134512   .0190085    -0.71   0.480    -.0509096    .0240071
         mafia |  -.0532475   .0239798    -2.22   0.027    -.1005023   -.0059927
       delitti |  -.0002054   .0001416    -1.45   0.148    -.0004845    .0000736
   laurea_rate |  -.1970878   .2467895    -0.80   0.425     -.683414    .2892383
  diploma_rate |  -.0467919   .0774951    -0.60   0.547    -.1995046    .1059208
    refturnout |   -.044123   .0215461    -2.05   0.042    -.0865819   -.0016641
      act_rate |   .0196353   .0423518     0.46   0.643    -.0638237    .1030943
    unemp_rate |   .0482598    .021222     2.27   0.024     .0064395    .0900802
       realgdp |   .0015525   .0049256     0.32   0.753     -.008154    .0112591
      urb_rate |   .0140871   .0065764     2.14   0.033     .0011277    .0270466
         _cons |   .0870082   .0288768     3.01   0.003     .0301034    .1439131
--------------------------------------------------------------------------------

. outreg2 using tables/lreg1b, `opt'
tables/lreg1b.xml
dir : seeout

. 
. areg p_votinonvalidi distanza turnout p_schedebianche ncandidati D*  if elettor
> i<=1200, cluster(id_coll) absorb(id)

Linear regression, absorbing indicators         Number of obs     =      7,275
                                                F(   6,    224)   =      11.42
                                                Prob > F          =     0.0000
                                                R-squared         =     0.6887
                                                Adj R-squared     =     0.5075
                                                Root MSE          =     0.0152

                                (Std. Err. adjusted for 225 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0094746   .0024993    -3.79   0.000    -.0143997   -.0045495
       turnout |  -.0397067   .0208521    -1.90   0.058    -.0807981    .0013848
p_schedebian~e |   .1321078   .0269132     4.91   0.000     .0790724    .1851432
    ncandidati |  -.0006999   .0007628    -0.92   0.360    -.0022031    .0008033
         D1996 |   .0025674   .0011989     2.14   0.033     .0002049    .0049298
         D2001 |  -.0012077   .0018273    -0.66   0.509    -.0048085    .0023931
         _cons |   .0682954   .0173048     3.95   0.000     .0341944    .1023965
---------------+----------------------------------------------------------------
            id |   absorbed                                    (2672 categories)

. outreg2 using tables/lreg1b, `opt'
tables/lreg1b.xml
dir : seeout

. */
. 
. * SECOND TABLE
. 
. foreach y of varlist turnout{
  2. su `y'
  3. gen `y'_sq=(`y'-r(mean))^2
  4. gen `y'_cu=(`y'-r(mean))^3
  5. gen `y'_ed1=`y'*laurea_rate 
  6. gen `y'_ed2=`y'*diploma_rate
  7. gen `y'_ed12=`y'_sq*laurea_rate 
  8. gen `y'_ed22=`y'_sq*diploma_rate
  9. gen `y'_ed13=`y'_cu*laurea_rate 
 10. gen `y'_ed23=`y'_cu*diploma_rate
 11. }

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
     turnout |     23,019    .8198278    .1084959   .0491968          1
(40 missing values generated)
(40 missing values generated)
(40 missing values generated)
(40 missing values generated)
(40 missing values generated)
(40 missing values generated)

. 
. 
. areg p_votinonvalidi distanza turnout turnout_sq turnout_cu p_schedebianche nca
> ndidati D*, cluster(id_coll)  absorb(id)

Linear regression, absorbing indicators         Number of obs     =     23,019
                                                F(   8,    474)   =      32.91
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7034
                                                Adj R-squared     =     0.5403
                                                Root MSE          =     0.0146

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0123087   .0035572    -3.46   0.001    -.0192986   -.0053188
       turnout |   .0153236   .1513197     0.10   0.919    -.2820169    .3126641
    turnout_sq |  -.1653473   .2853067    -0.58   0.562    -.7259697    .3952751
    turnout_cu |  -.2814111   .1849754    -1.52   0.129    -.6448843    .0820622
p_schedebian~e |    .132508   .0519666     2.55   0.011     .0303945    .2346215
    ncandidati |    -.00056   .0005446    -1.03   0.304    -.0016301      .00051
         D1996 |   .0037803   .0047978     0.79   0.431    -.0056473    .0132078
         D2001 |   -.000674   .0077464    -0.09   0.931    -.0158955    .0145475
         _cons |    .024948   .1292721     0.19   0.847    -.2290692    .2789653
---------------+----------------------------------------------------------------
            id |   absorbed                                    (8161 categories)

. outreg2 using tables/lreg2, `opt' replace
tables/lreg2.xml
dir : seeout

. 
. areg p_votinonvalidi distanza turnout* p_schedebianche ncandidati D*, cluster(i
> d_coll)  absorb(id)

Linear regression, absorbing indicators         Number of obs     =     22,105
                                                F(  15,    464)   =      25.00
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7151
                                                Adj R-squared     =     0.5517
                                                Root MSE          =     0.0145

                                (Std. Err. adjusted for 465 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0097555   .0025284    -3.86   0.000    -.0147241    -.004787
       turnout |  -.1326325   .1928446    -0.69   0.492    -.5115895    .2463244
     turnout_p |  -.0056521   .0080772    -0.70   0.484    -.0215245    .0102203
    turnout_sq |  -.8128552   .6598601    -1.23   0.219    -2.109539     .483829
    turnout_cu |   .2845165   1.966604     0.14   0.885    -3.580037     4.14907
   turnout_ed1 |  -16.88347   7.972438    -2.12   0.035    -32.55002   -1.216909
   turnout_ed2 |   4.425192   1.954561     2.26   0.024     .5843029     8.26608
  turnout_ed12 |  -96.46029   63.07244    -1.53   0.127    -220.4033    27.48272
  turnout_ed22 |   24.49555   15.46107     1.58   0.114    -5.886851    54.87794
  turnout_ed13 |  -128.6934   105.6857    -1.22   0.224    -336.3754    78.98854
  turnout_ed23 |   27.69058   24.76425     1.12   0.264    -20.97339    76.35455
p_schedebian~e |   .1306289   .0534506     2.44   0.015     .0255937    .2356641
    ncandidati |  -.0008212   .0005109    -1.61   0.109    -.0018251    .0001828
         D1996 |   .0037533   .0047978     0.78   0.434    -.0056747    .0131813
         D2001 |   -.001076   .0076875    -0.14   0.889    -.0161825    .0140305
         _cons |   .0034937   .1428149     0.02   0.980    -.2771503    .2841378
---------------+----------------------------------------------------------------
            id |   absorbed                                    (8042 categories)

. outreg2 using tables/lreg2, `opt'
tables/lreg2.xml
dir : seeout

. 
. areg p_votinonvalidi distanza turnout p_schedebianche ncandidati D* if north==1
> , cluster(id_coll)  absorb(id)

Linear regression, absorbing indicators         Number of obs     =     13,261
                                                F(   6,    211)   =      64.95
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7093
                                                Adj R-squared     =     0.5568
                                                Root MSE          =     0.0099

                                (Std. Err. adjusted for 212 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0059752   .0015153    -3.94   0.000    -.0089621   -.0029882
       turnout |  -.0069767   .0129342    -0.54   0.590    -.0324734      .01852
p_schedebian~e |   .1486105   .0229982     6.46   0.000     .1032748    .1939463
    ncandidati |   .0009572   .0003617     2.65   0.009     .0002443    .0016702
         D1996 |   .0058748   .0007332     8.01   0.000     .0044295    .0073201
         D2001 |    .007067   .0010351     6.83   0.000     .0050265    .0091075
         _cons |   .0261054   .0115471     2.26   0.025      .003343    .0488678
---------------+----------------------------------------------------------------
            id |   absorbed                                    (4558 categories)

. outreg2 using tables/lreg2, `opt'
tables/lreg2.xml
dir : seeout

. 
. areg p_votinonvalidi distanza turnout p_schedebianche ncandidati D* if north==0
> , cluster(id_coll)  absorb(id)

Linear regression, absorbing indicators         Number of obs     =      9,718
                                                F(   6,    260)   =      37.86
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7261
                                                Adj R-squared     =     0.5672
                                                Root MSE          =     0.0173

                                (Std. Err. adjusted for 261 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0175014   .0038465    -4.55   0.000    -.0250756   -.0099273
       turnout |   .1271533   .1736421     0.73   0.465    -.2147707    .4690772
p_schedebian~e |    .034258   .0994719     0.34   0.731    -.1616152    .2301312
    ncandidati |   -.000192   .0006046    -0.32   0.751    -.0013826    .0009986
         D1996 |   .0095255   .0067914     1.40   0.162    -.0038476    .0228986
         D2001 |   -.006507   .0071042    -0.92   0.361     -.020496     .007482
         _cons |  -.0488024   .1314257    -0.37   0.711    -.3075967    .2099919
---------------+----------------------------------------------------------------
            id |   absorbed                                    (3563 categories)

. outreg2 using tables/lreg2, `opt'
tables/lreg2.xml
dir : seeout

. 
. areg p_votinonvalidi distanza turnout p_schedebianche ncandidati di_turn di_nca
> nd D*, cluster(id_coll) absorb(id)

Linear regression, absorbing indicators         Number of obs     =     23,019
                                                F(   8,    474)   =      32.44
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7030
                                                Adj R-squared     =     0.5396
                                                Root MSE          =     0.0146

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |   .0352688   .0195511     1.80   0.072    -.0031488    .0736863
       turnout |   .0158974   .0906771     0.18   0.861    -.1622814    .1940763
p_schedebian~e |   .1346756    .046219     2.91   0.004     .0438561    .2254951
    ncandidati |  -.0005446   .0005483    -0.99   0.321     -.001622    .0005329
       di_turn |  -.0448542    .018477    -2.43   0.016    -.0811611   -.0085472
      di_ncand |  -.0028848   .0016697    -1.73   0.085    -.0061658    .0003962
         D1996 |   .0037269   .0031572     1.18   0.238    -.0024768    .0099307
         D2001 |  -.0004851   .0049013    -0.10   0.921    -.0101161    .0091459
         _cons |   .0142497   .0776514     0.18   0.854    -.1383339    .1668333
---------------+----------------------------------------------------------------
            id |   absorbed                                    (8161 categories)

. outreg2 using tables/lreg2, `opt'
tables/lreg2.xml
dir : seeout

. 
. areg p_votinonvalidi distanza turnout p_schedebianche ncandidati di_turn di_nca
> nd D* if north==1, cluster(id_coll) absorb(id)

Linear regression, absorbing indicators         Number of obs     =     13,261
                                                F(   8,    211)   =      58.53
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7097
                                                Adj R-squared     =     0.5572
                                                Root MSE          =     0.0099

                                (Std. Err. adjusted for 212 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |   .0130157   .0310118     0.42   0.675    -.0481171    .0741484
       turnout |   -.007254   .0130601    -0.56   0.579    -.0329991     .018491
p_schedebian~e |   .1484101   .0230297     6.44   0.000     .1030124    .1938078
    ncandidati |   .0009224   .0003562     2.59   0.010     .0002202    .0016246
       di_turn |  -.0280797   .0310768    -0.90   0.367    -.0893404    .0331811
      di_ncand |   .0013189   .0016518     0.80   0.426    -.0019373    .0045752
         D1996 |   .0056936   .0007841     7.26   0.000      .004148    .0072392
         D2001 |   .0069914   .0010716     6.52   0.000      .004879    .0091038
         _cons |   .0230971   .0106089     2.18   0.031     .0021841    .0440101
---------------+----------------------------------------------------------------
            id |   absorbed                                    (4558 categories)

. outreg2 using tables/lreg2, `opt'
tables/lreg2.xml
dir : seeout

. 
. areg p_votinonvalidi distanza turnout p_schedebianche ncandidati di_turn di_nca
> nd D* if north==0, cluster(id_coll) absorb(id)

Linear regression, absorbing indicators         Number of obs     =      9,718
                                                F(   8,    260)   =      30.41
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7270
                                                Adj R-squared     =     0.5685
                                                Root MSE          =     0.0172

                                (Std. Err. adjusted for 261 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |    .046879   .0241064     1.94   0.053    -.0005896    .0943476
       turnout |   .1254372   .1728583     0.73   0.469    -.2149432    .4658176
p_schedebian~e |   .0338295   .0993629     0.34   0.734    -.1618289    .2294879
    ncandidati |  -.0002593   .0006102    -0.42   0.671    -.0014609    .0009422
       di_turn |  -.0804225   .0312088    -2.58   0.011    -.1418766   -.0189683
      di_ncand |  -.0013751   .0020484    -0.67   0.503    -.0054087    .0026585
         D1996 |   .0093065   .0067303     1.38   0.168    -.0039462    .0225593
         D2001 |  -.0066849   .0070398    -0.95   0.343    -.0205472    .0071774
         _cons |  -.0589525   .1336199    -0.44   0.659    -.3220674    .2041623
---------------+----------------------------------------------------------------
            id |   absorbed                                    (3563 categories)

. outreg2 using tables/lreg2, `opt'
tables/lreg2.xml
dir : seeout

. 
. 
. 
. * THIRD TABLE
. 
. qui su distanza

. local rmean=r(mean)

. qui su c_distanza

. gen inter=(c_distanza-r(mean))*(distanza-`rmean')

. 
. areg p_votinonvalidi distanza c_distanza turnout p_schedebianche ncandidati D* 
> destra1 sinistra1, cluster(id_coll) absorb(id)

Linear regression, absorbing indicators         Number of obs     =     23,019
                                                F(   9,    474)   =      28.62
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7059
                                                Adj R-squared     =     0.5442
                                                Root MSE          =     0.0145

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0093866   .0024754    -3.79   0.000    -.0142506   -.0045225
    c_distanza |  -.0098111   .0058595    -1.67   0.095    -.0213249    .0017027
       turnout |    .018829   .0907534     0.21   0.836    -.1594997    .1971577
p_schedebian~e |   .1318472   .0468863     2.81   0.005     .0397165    .2239778
    ncandidati |  -.0007073   .0005375    -1.32   0.189    -.0017634    .0003488
         D1996 |   .0027109   .0035289     0.77   0.443    -.0042233    .0096451
         D2001 |  -.0035423   .0050429    -0.70   0.483    -.0134516    .0063669
       destra1 |   -.004685   .0010708    -4.38   0.000    -.0067892   -.0025808
     sinistra1 |  -.0015643   .0009769    -1.60   0.110    -.0034839    .0003554
         _cons |    .025823    .076184     0.34   0.735    -.1238771     .175523
---------------+----------------------------------------------------------------
            id |   absorbed                                    (8161 categories)

. outreg2 using tables/lreg3, `opt' replace
tables/lreg3.xml
dir : seeout

.  
. areg p_votinonvalidi distanza c_distanza inter turnout p_schedebianche ncandida
> ti D* destra1 sinistra1, cluster(id_coll) absorb(id)

Linear regression, absorbing indicators         Number of obs     =     23,019
                                                F(  10,    474)   =      32.81
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7071
                                                Adj R-squared     =     0.5459
                                                Root MSE          =     0.0145

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |   -.008279   .0024724    -3.35   0.001    -.0131373   -.0034207
    c_distanza |  -.0061396     .00634    -0.97   0.333    -.0185975    .0063183
         inter |  -.0553753   .0155048    -3.57   0.000    -.0858419   -.0249086
       turnout |   .0201548   .0908363     0.22   0.825    -.1583367    .1986463
p_schedebian~e |   .1291458    .047147     2.74   0.006     .0365029    .2217888
    ncandidati |   -.000775   .0005325    -1.46   0.146    -.0018214    .0002713
         D1996 |   .0025824   .0035164     0.73   0.463    -.0043273    .0094922
         D2001 |  -.0035898   .0050383    -0.71   0.477      -.01349    .0063104
       destra1 |   -.004348   .0010421    -4.17   0.000    -.0063957   -.0023003
     sinistra1 |  -.0010166    .000959    -1.06   0.290     -.002901    .0008677
         _cons |   .0248262    .076243     0.33   0.745    -.1249899    .1746423
---------------+----------------------------------------------------------------
            id |   absorbed                                    (8161 categories)

. outreg2 using tables/lreg3, `opt'
tables/lreg3.xml
dir : seeout

. drop inter 

. 
. qui su distanza if elettori<=1200

. local rmean=r(mean)

. qui su c_distanza

. gen inter=(c_distanza-r(mean))*(distanza-`rmean')

. 
. areg p_votinonvalidi distanza c_distanza turnout p_schedebianche ncandidati D* 
> destra1 sinistra1  if elettori<=1200, cluster(id_coll) absorb(id)

Linear regression, absorbing indicators         Number of obs     =      7,275
                                                F(   9,    224)   =       8.25
                                                Prob > F          =     0.0000
                                                R-squared         =     0.6931
                                                Adj R-squared     =     0.5141
                                                Root MSE          =     0.0151

                                (Std. Err. adjusted for 225 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0058907    .002808    -2.10   0.037    -.0114241   -.0003572
    c_distanza |   -.010656   .0062056    -1.72   0.087    -.0228848    .0015728
       turnout |  -.0401817    .020498    -1.96   0.051    -.0805753     .000212
p_schedebian~e |   .1299688   .0265972     4.89   0.000      .077556    .1823816
    ncandidati |  -.0008856    .000765    -1.16   0.248    -.0023932    .0006219
         D1996 |   .0007856   .0014709     0.53   0.594     -.002113    .0036841
         D2001 |  -.0054291    .001948    -2.79   0.006    -.0092678   -.0015904
       destra1 |  -.0051479   .0016542    -3.11   0.002    -.0084076   -.0018882
     sinistra1 |  -.0015371   .0014551    -1.06   0.292    -.0044046    .0013304
         _cons |   .0748732   .0167616     4.47   0.000     .0418426    .1079039
---------------+----------------------------------------------------------------
            id |   absorbed                                    (2672 categories)

. outreg2 using tables/lreg3, `opt' 
tables/lreg3.xml
dir : seeout

.  
. areg p_votinonvalidi distanza c_distanza inter turnout p_schedebianche ncandida
> ti D* destra1 sinistra1  if elettori<=1200, cluster(id_coll) absorb(id)

Linear regression, absorbing indicators         Number of obs     =      7,275
                                                F(  10,    224)   =      14.50
                                                Prob > F          =     0.0000
                                                R-squared         =     0.6940
                                                Adj R-squared     =     0.5154
                                                Root MSE          =     0.0151

                                (Std. Err. adjusted for 225 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0047559   .0028875    -1.65   0.101     -.010446    .0009342
    c_distanza |   -.007729   .0065992    -1.17   0.243    -.0207335    .0052754
         inter |  -.0432372     .01646    -2.63   0.009    -.0756734    -.010801
       turnout |  -.0389364   .0207207    -1.88   0.062    -.0797687     .001896
p_schedebian~e |   .1261889   .0269768     4.68   0.000      .073028    .1793498
    ncandidati |  -.0009884   .0007512    -1.32   0.190    -.0024687    .0004919
         D1996 |   .0006846   .0014693     0.47   0.642    -.0022107      .00358
         D2001 |  -.0055344   .0019551    -2.83   0.005    -.0093872   -.0016817
       destra1 |  -.0049287   .0016436    -3.00   0.003    -.0081677   -.0016897
     sinistra1 |  -.0010344   .0014595    -0.71   0.479    -.0039104    .0018417
         _cons |   .0741953   .0169431     4.38   0.000      .040807    .1075836
---------------+----------------------------------------------------------------
            id |   absorbed                                    (2672 categories)

. outreg2 using tables/lreg3, `opt'
tables/lreg3.xml
dir : seeout

. drop inter 

. 
. */
. 
. 
. 
. 
. * FOURTH TABLE INTERACTIONS
. local replace "replace"

. foreach y of varlist delitti_pa mafia dmafia{
  2. qui su distanza
  3. local rmean=r(mean)
  4. qui su `y'
  5. 
. gen inter=(`y'-r(mean))/r(sd)*(distanza-`rmean')
  6. reg p_votinonvalidi distanza `y' inter turnout p_schedebianche ncandidati D*
> , cluster(id_coll)
  7. outreg2 using tables/lreg4, `opt' `replace'
  8. local replace ""
  9. areg p_votinonvalidi distanza `y' inter turnout p_schedebianche ncandidati D
> *, cluster(id_coll) absorb(id)
 10. outreg2 using tables/lreg4, `opt' `replace'
 11. drop inter
 12. }

Linear regression                               Number of obs     =     23,019
                                                F(8, 474)         =      69.17
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1687
                                                Root MSE          =     .01963

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0175224   .0019949    -8.78   0.000    -.0214423   -.0136026
    delitti_pa |   .0543131   .0260231     2.09   0.037     .0031781     .105448
         inter |   .0013194   .0013183     1.00   0.317     -.001271    .0039098
       turnout |  -.0478272   .0067837    -7.05   0.000     -.061157   -.0344975
p_schedebian~e |   .2065461   .0195446    10.57   0.000     .1681413    .2449509
    ncandidati |   .0001842   .0004705     0.39   0.696    -.0007403    .0011088
         D1996 |   .0024939   .0007751     3.22   0.001     .0009708     .004017
         D2001 |  -.0032449   .0010356    -3.13   0.002      -.00528   -.0012099
         _cons |   .0710239   .0070294    10.10   0.000     .0572113    .0848365
--------------------------------------------------------------------------------
tables/lreg4.xml
dir : seeout
note: delitti_pa omitted because of collinearity

Linear regression, absorbing indicators         Number of obs     =     23,019
                                                F(   7,    474)   =      33.16
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7024
                                                Adj R-squared     =     0.5387
                                                Root MSE          =     0.0146

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0137096   .0018972    -7.23   0.000    -.0174375   -.0099817
    delitti_pa |          0  (omitted)
         inter |  -.0017795   .0014612    -1.22   0.224    -.0046507    .0010917
       turnout |   .0164227   .0908657     0.18   0.857    -.1621267     .194972
p_schedebian~e |   .1344772    .046243     2.91   0.004     .0436106    .2253438
    ncandidati |   -.000535   .0005476    -0.98   0.329    -.0016111     .000541
         D1996 |   .0039342   .0031874     1.23   0.218     -.002329    .0101974
         D2001 |  -.0002406   .0049468    -0.05   0.961     -.009961    .0094798
         _cons |   .0225385   .0761137     0.30   0.767    -.1270235    .1721006
---------------+----------------------------------------------------------------
            id |   absorbed                                    (8161 categories)
tables/lreg4.xml
dir : seeout

Linear regression                               Number of obs     =     23,019
                                                F(8, 474)         =      69.09
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1700
                                                Root MSE          =     .01961

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0175362   .0019925    -8.80   0.000    -.0214515   -.0136209
         mafia |   .0733685   .0295632     2.48   0.013     .0152773    .1314598
         inter |  -.0013914   .0014862    -0.94   0.350    -.0043117     .001529
       turnout |  -.0476021    .006813    -6.99   0.000    -.0609896   -.0342146
p_schedebian~e |   .2060438   .0196577    10.48   0.000     .1674168    .2446709
    ncandidati |   .0001266   .0004631     0.27   0.785    -.0007834    .0010367
         D1996 |   .0024678   .0007745     3.19   0.002      .000946    .0039897
         D2001 |  -.0032224   .0010417    -3.09   0.002    -.0052694   -.0011754
         _cons |   .0706179   .0070887     9.96   0.000     .0566887    .0845471
--------------------------------------------------------------------------------
tables/lreg4.xml
dir : seeout
note: mafia omitted because of collinearity

Linear regression, absorbing indicators         Number of obs     =     23,019
                                                F(   7,    474)   =      33.80
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7023
                                                Adj R-squared     =     0.5386
                                                Root MSE          =     0.0146

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0136694   .0018882    -7.24   0.000    -.0173797   -.0099591
         mafia |          0  (omitted)
         inter |  -.0002455   .0014191    -0.17   0.863     -.003034    .0025431
       turnout |   .0164489   .0908617     0.18   0.856    -.1620927    .1949906
p_schedebian~e |   .1346973   .0462702     2.91   0.004     .0437773    .2256173
    ncandidati |  -.0005346   .0005479    -0.98   0.330    -.0016112     .000542
         D1996 |   .0039276   .0031867     1.23   0.218    -.0023343    .0101895
         D2001 |  -.0002473   .0049465    -0.05   0.960    -.0099672    .0094726
         _cons |   .0225064   .0761107     0.30   0.768    -.1270497    .1720626
---------------+----------------------------------------------------------------
            id |   absorbed                                    (8161 categories)
tables/lreg4.xml
dir : seeout

Linear regression                               Number of obs     =     23,019
                                                F(8, 474)         =      74.07
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1751
                                                Root MSE          =     .01955

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0175459   .0019835    -8.85   0.000    -.0214436   -.0136483
        dmafia |   .0137688   .0025789     5.34   0.000     .0087014    .0188362
         inter |   .0015543   .0015693     0.99   0.322    -.0015293     .004638
       turnout |  -.0464412   .0067114    -6.92   0.000    -.0596289   -.0332534
p_schedebian~e |   .2070868    .019643    10.54   0.000     .1684887     .245685
    ncandidati |    .000105   .0004649     0.23   0.821    -.0008086    .0010186
         D1996 |   .0024899   .0007744     3.22   0.001     .0009683    .0040116
         D2001 |  -.0031747   .0010422    -3.05   0.002    -.0052227   -.0011267
         _cons |   .0699979   .0069546    10.06   0.000     .0563322    .0836635
--------------------------------------------------------------------------------
tables/lreg4.xml
dir : seeout
note: dmafia omitted because of collinearity

Linear regression, absorbing indicators         Number of obs     =     23,019
                                                F(   7,    474)   =      32.69
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7026
                                                Adj R-squared     =     0.5390
                                                Root MSE          =     0.0146

                                (Std. Err. adjusted for 475 clusters in id_coll)
--------------------------------------------------------------------------------
               |               Robust
p_votinonval~i |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------+----------------------------------------------------------------
      distanza |  -.0137028   .0019174    -7.15   0.000    -.0174705   -.0099352
        dmafia |          0  (omitted)
         inter |  -.0044226   .0049343    -0.90   0.371    -.0141184    .0052733
       turnout |   .0163897   .0906231     0.18   0.857     -.161683    .1944624
p_schedebian~e |   .1348351   .0460959     2.93   0.004     .0442575    .2254126
    ncandidati |  -.0005418   .0005455    -0.99   0.321    -.0016137    .0005301
         D1996 |   .0039804   .0032304     1.23   0.218    -.0023672     .010328
         D2001 |  -.0002067    .004976    -0.04   0.967    -.0099845    .0095711
         _cons |   .0225479   .0759197     0.30   0.767     -.126633    .1717288
---------------+----------------------------------------------------------------
            id |   absorbed                                    (8161 categories)
tables/lreg4.xml
dir : seeout

. 
. 
. 
. log close
      name:  <unnamed>
       log:  C:\DATA\Dropbox\PoliticalEconomy\analysis.log
  log type:  text
 closed on:   1 Jun 2016, 12:10:21
---------------------------------------------------------------------------------
